home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / WHIP16.422 < prev    next >
Text File  |  1993-02-25  |  5KB  |  177 lines

  1. WHIP16.MOD
  2. Whiplash #1 @3651
  3. Wed Feb 24 15:21:11 1993
  4.  
  5. ┌────────────────────────────────────────────────────────────────────────────┐
  6. │ Mod Name:       WHIP16.MOD      Mod Author:  Whiplash                      │
  7. │ Difficulty:     Easy                  Date:  February 24, 1993             │
  8. │ WWIV Version:   4.22                                                       │
  9. │ Description:    Send mail to ALL users.                                    │                                                                            │
  10. └────────────────────────────────────────────────────────────────────────────┘
  11.  
  12. Well guys, I did not write most of this mod.  This mod was written years ago,
  13. I just changed a few things to make it work with 4.22.  Someone else released
  14. it, but I could not find the original mod, so I can't thank or give credit to
  15. the guy.  But, I can't take credit either.  Part of the reason I put this out
  16. is because I have heard a few requests from people, and I never saw anyone
  17. post it, so I decided that I shall do it.
  18.  
  19. Anyways, this mod will send mail to all your users on your system.  Works
  20. pretty cool, but I must warn you, if you have alot of users, it will make
  21. your email file much larger and slower.  So, be sure and delete users who never
  22. call your system.
  23.  
  24.  
  25. Step #1:  Don't back up your source.  If this screws up, take down your board
  26.           and move to the arctic.
  27.  
  28. Step #2:  Open up MULTMAIL.C and put this void in at the end:
  29.  
  30. void mailall()
  31. {
  32.   int i,i1,f,len,an,cv,ok;
  33.   mailrec m,m1;
  34.   char s[81],s1[81],t[81];
  35.   userrec ur;
  36.   slrec ss;
  37.  
  38.   if (freek1(syscfg.msgsdir)<10.0) {
  39.     nl();
  40.     pl("Sorry, not enough disk space left.");
  41.     nl();
  42.     return;
  43.   }
  44.   nl();
  45.   sprintf(s,"%sEMAIL.DAT",syscfg.datadir);
  46.   ss=syscfg.sl[actsl];
  47.  
  48.   if (ss.ability & ability_email_anony)
  49.     i=anony_enable_anony;
  50.   else
  51.     i=0;
  52.   m.msg.storage_type=EMAIL_STORAGE;
  53.   strcpy(irt,"Multimail from Whiplash");  /*  Change This  */
  54.   irt_name[0]=0;
  55.  
  56.   inmsg(&m.msg,t,&i,1,"EMAIL",ALLOW_FULLSCREEN, "Multi-Mail", 0);
  57.   if (m.msg.stored_as==0xffffffff)
  58.     return;
  59.   strcpy(m.title,t);
  60.   m.anony=i;
  61.   m.fromsys=0;
  62.   m.fromuser=usernum;
  63.   m.tosys=0;
  64.   m.touser=0;
  65.   m.status=status_multimail;
  66.   time((long *)&(m.daten));
  67.   f=open(s,O_RDWR | O_BINARY | O_CREAT, S_IREAD | S_IWRITE);
  68.   len=(int) filelength(f)/sizeof(mailrec);
  69.   if (len==0)
  70.     i=0;
  71.   else {
  72.     i=len-1;
  73.     lseek(f,((long) (i))*(sizeof(mailrec)), SEEK_SET);
  74.     read(f,(void *)&m1,sizeof(mailrec));
  75.     while ((i>0) && (m1.tosys==0) && (m1.touser==0)) {
  76.       --i;
  77.       lseek(f,((long) (i))*(sizeof(mailrec)), SEEK_SET);
  78.       i1=read(f,(void *)&m1,sizeof(mailrec));
  79.       if (i1==-1)
  80.         pl("DIDN'T READ RIGHT.");
  81.     }
  82.     if ((m1.tosys) || (m1.touser))
  83.       ++i;
  84.   }
  85.   lseek(f,((long) (i))*(sizeof(mailrec)), SEEK_SET);
  86.   pl("Mail sent to:");
  87.   sysoplog("Multi-Mail sent to all users . . .");
  88.  
  89.   for (cv=0; cv<status.users; cv++) {
  90.     read_user(smallist[cv].number,&ur);
  91.                                                       ok=1;
  92.     if (((ur.sl==255) && (ur.waiting>(syscfg.maxwaiting * 5))) ||
  93.         ((ur.sl!=255) && (ur.waiting>syscfg.maxwaiting)) ||
  94.         (ur.waiting>200)) {
  95.       sprintf(s,"%s  mailbox full, not sent.",nam(&ur,smallist[cv].number));
  96.       sysoplog(s);
  97.       npr(s);
  98.       nl();
  99.       ok=0;
  100.     }
  101.     if (ur.inact & inact_deleted) {
  102.       sprintf(s,"User #%d deleted, not sent.",smallist[cv].number);
  103.       sysoplog(s);
  104.       npr(s);
  105.       nl();
  106.       ok=0;
  107.     }
  108.  
  109.     if (ok) {
  110.       m.touser=smallist[cv].number;
  111.       write(f,(void *)&m,sizeof(mailrec));
  112.       strcpy(s,"   ");
  113.       ++ur.waiting;
  114.       write_user(smallist[cv].number,&ur);
  115.                                                         if (smallist[cv].number==1)
  116.         ++fwaiting;
  117.       strcat(s,nam(&ur,smallist[cv].number));
  118.       if (smallist[cv].number==1)  {
  119.         ++status.fbacktoday;
  120.         ++thisuser.feedbacksent;
  121.         ++thisuser.fsenttoday1;
  122.         ++fsenttoday;
  123.       } else {
  124.         ++status.emailtoday;
  125.         ++thisuser.etoday;
  126.         ++thisuser.emailsent;
  127.       }
  128.       pl(s);
  129.     }
  130.   }
  131.   close_user();
  132.   close(f);
  133.   save_status();
  134.   if (!wfc)
  135.     topscreen();
  136. }
  137.  
  138. Step #3:  Now save it, and open up BBS.C and go to void mainmenu();
  139.  
  140. Step #4:  Add the following into the code:
  141.  
  142.  
  143.     if (strcmp(s,"BOARDEDIT")==0) {
  144.       sysoplog(get_stringx(1,2));
  145.       boardedit();
  146.     }
  147. +   if (strcmp(s,"MAILALL")==0) {
  148. +     sysoplog("@ Emailed Each and Every User!");
  149. +     mailall();
  150. +   }
  151.     if (strcmp(s,"DIREDIT")==0) {
  152.       sysoplog(get_stringx(1,3));
  153.       dlboardedit();
  154.     }
  155.  
  156. Step #5:  Save and compile!
  157.  
  158.  
  159. Step #6:  This step for rent.
  160.  
  161. Step #7:  Email me, and tell me how much you hate it, so I will stop putting
  162.           out such foolish trash.
  163.  
  164.  
  165. If it causes a solar eclipse, the ozone to explode, Mother Theresa to lose her
  166. virginity and makes John C. Holmes come back to life, it's your fault.
  167.  
  168. If you have any questions, email me:
  169. WWIVnet 1@3653
  170. SOLARnet 1@13651
  171. IceNET 1@3652
  172. GATEWAY 1@2
  173.  
  174. or call my sucky board:  Out Of Time, (316)/788-9495....
  175.  
  176. Well boys, that's it for this time... Z-ya......
  177.